package org.gary.admin.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 管理员类
 * @author lengreen
 * 
 */
@Entity
public class Administrator implements lengreen.core.interfaces.Entity {
	/**
	 * 在记录日志中需要用到该方法
	 */
	@Override
	public String toString() {
		return "Administrator [createDate=" + createDate + ", id=" + id
				+ ", 登录密码=" + password + ", 登录用户名=" + username + ", 是否可见="
				+ visible + "]";
	}

	private int id;
	private boolean visible;
	private String username;
	private String password;

	private Date createDate;

	public Administrator() {
		setCreateDate(new Date());
		setVisible(true);
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}
